/**
 * Created by Rossy1 on 2018/4/28.
 */
document.documentElement.style.fontSize = document.documentElement.clientWidth / 3.75 + "px"; //兼容处理

//查询录音地址
$.ajax({
    type: "GET",
    url: "http://120.24.67.44/xcx/handle_data_app.php",
    data: {
        func: "queryRecordUrl",
        rid: "cc4edf0ee80de049024afbca60e1c068b50df8e3"
    },
    success: function (res) {
        $("#audio").attr("src", JSON.parse(res).mp3);
        autoPlayAudio();
    },
    error: function (res) {

    }
});

function autoPlayAudio() {
    document.getElementById("audio").play();
    $("#chpdiv").addClass("rainbow");
    wx.config({
        debug: false,
        appId: '',
        timestamp: 1,
        nonceStr: '',
        signature: '',
        jsApiList: []
    });
    wx.ready(function () {
        document.getElementById('audio').play();
    });
}

//点击暂停/播放
var f = true;
$("#btn").on("click", function () {
    if (f) {
        $("#audio")[0].pause();
        $("#btn").attr("src", "img/stop.png");
        f = false;
    } else {
        $("#audio")[0].play();
        $("#btn").attr("src", "img/play.png");
        f = true;
    }
})

//点击跳转播放歌曲
$(".focusMan").on("click", function () {

    window.location.href = "playMusic.html";
})








